<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        // 页面加载完成后 执行函数
        window.onload = function (){
            var btn = document.getElementsByTagName('button')[0]
            console.log(btn);
        }
    </script>
</head>
<body>

<button>按钮</button>

</body>
</html>